package cn.meng.base.controller;

import cn.meng.base.vo.ExceptionMessageVo;
import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 全局无权限请求转发处理，使用 @CrossOrigin 注解处理跨域
 * @author 万梦辉
 */
@RestController
@RequestMapping("/golbal")
public class GolbalNoPermissionController {

    @RequestMapping("/sendNoPermissionMessage")
    @CrossOrigin
    public String sendNoPermissionMessage() {
        ExceptionMessageVo messageVo = new ExceptionMessageVo(401, "该账号没有对应的权限！");
        return JSON.toJSONString(messageVo);
    }

}
